package active.state.lottery;

public class ClientLotteryState {

    static LotteryActivity lotteryActivity = new LotteryActivity(1);

    public static void main(String[] args) {

        for (int i = 0; i < 10; i++) {
            int finalI = i;
            new Thread(() -> {
                executeTask(finalI);
            }).start();
        }
    }

    private static void executeTask(int i) {
        synchronized (ClientLotteryState.class) {
            System.out.println("==========第" + i + "次抽奖==========");
            lotteryActivity.debuctScore();
            lotteryActivity.lotteryDraw();
        }
    }
}
